****This do-file provides the cleaning code for the variables used in the analyses
***beginning with the attitude strength measures themselves (both w1 and w9 in the panel)
***then disagreement and then controls



			*********Attitude Strength Measures
*******Wave 1 and Wave 10


*****Same Sex Marriage*
	****Wave 1****
		*Attitude Itself**
		*Dem Position = Oppose a Ban = High Values*
			gen samesex1 = . 
			replace samesex1 = 7 if W1P1 == 2 & W1P_O_2 == 1
			replace samesex1 = 6 if W1P1 == 2 & W1P_O_2 == 2
			replace samesex1 = 5 if W1P1 == 2 & W1P_O_2 == 3
			replace samesex1 = 4 if W1P1 == 3
			replace samesex1 = 3 if W1P1 == 1 & W1P_F_2 == 3
			replace samesex1 = 2 if W1P1 == 1 & W1P_F_2 == 2
			replace samesex1 = 1 if W1P1 == 1 & W1P_F_2 == 1
			label var samesex1 "Support/Opposition to Same Sex Marriage Ban (W1)"
			label def same 1 "Great Deal Support" 2 "Moderate Support" 3 "Little Support" 4 "Neither" 5 "Little Oppose" 6 "Moderate Oppose" 7 "Great Deal of Opposition"
			label values samesex1 same
			
			su samesex1, meanonly
			gen samesex101 = (samesex1 - r(min))/(r(max)-r(min))
			label var samesex101 "Support/Opposition to Same Sex Marriage Ban (W1, 0-1)"

		**Attitude Extremity**
			gen samesex1ext = . 
			replace samesex1ext = 1 if samesex1 == 4
			replace samesex1ext = 2 if samesex1 == 3
			replace samesex1ext = 2 if samesex1 == 5
			replace samesex1ext = 3 if samesex1 == 2
			replace samesex1ext = 3 if samesex1 == 6
			replace samesex1ext = 4 if samesex1 == 7
			replace samesex1ext = 4 if samesex1 == 1
			label var samesex1ext "Extremity of Same Sex Attitude (W1)"
			label def extreme 1 "Neither" 2 "A Little" 3 "Moderately" 4 "A Great Deal"
			label values samesex1ext extreme
			
			su samesex1ext, meanonly
			gen samesex1ext01 = (samesex1ext - r(min))/(r(max)-r(min))
			label var samesex1ext01 "Extremity of Same Sex Attitude (W1, 0-1)"

		**Attitude Importance**

			gen samesex1imp = .
			replace samesex1imp = 1 if W1P3 == 5
			replace samesex1imp = 2 if W1P3 == 4
			replace samesex1imp = 3 if W1P3 == 3
			replace samesex1imp = 4 if W1P3 == 2
			replace samesex1imp = 5 if W1P3 == 1
			label var samesex1imp "Importance of Sam Sex Attitude (W1)"
			label def importa 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Very" 5 "Extremely"
			label values samesex1imp importa

			su samesex1imp, meanonly
			gen samesex1imp01 = (samesex1imp - r(min))/(r(max)-r(min))
			label var samesex1imp01 "Importance of Same Sex Atittude (W1, 0-1)"

	******Wave 10*****
		*Attitude itself**
			gen samesex10 = . 
			replace samesex10 = 7 if W10P1 == 2 & W10P2_OP == 1
			replace samesex10 = 6 if W10P1 == 2 & W10P2_OP == 2
			replace samesex10 = 5 if W10P1 == 2 & W10P2_OP == 3
			replace samesex10 = 4 if W10P1 == 3
			replace samesex10 = 3 if W10P1 == 1 & W10P2_FA == 3
			replace samesex10 = 2 if W10P1 == 1 & W10P2_FA == 2
			replace samesex10 = 1 if W10P1 == 1 & W10P2_FA == 1
			label var samesex10 "Support/Opposition to Same Sex Marriage Ban (W10)"
			label values samesex10 same
			
			su samesex10, meanonly
			gen samesex1001 = (samesex10 - r(min))/(r(max)-r(min))
			label var samesex1001 "Support/Opposition to Same Sex Marriage Ban (W10, 0-1)"

		***Attitude Extremity***

			gen samesex10ext = . 
			replace samesex10ext = 1 if samesex10 == 4
			replace samesex10ext = 2 if samesex10 == 3
			replace samesex10ext = 2 if samesex10 == 5
			replace samesex10ext = 3 if samesex10 == 2
			replace samesex10ext = 3 if samesex10 == 6
			replace samesex10ext = 4 if samesex10 == 7
			replace samesex10ext = 4 if samesex10 == 1
			label var samesex10ext "Extremity of Same Sex Attitude (W10)"
			label values samesex10ext extreme
			su samesex10ext, meanonly
			gen samesex10ext01 = (samesex10ext - r(min))/(r(max)-r(min))
			label var samesex10ext01 "Extremity of Same Sex Attitude (W10, 0-1)"

		**Attitude Importance****
			gen samesex10imp = .
			replace samesex10imp = 1 if W10P3 == 5
			replace samesex10imp = 2 if W10P3 == 4
			replace samesex10imp = 3 if W10P3 == 3
			replace samesex10imp = 4 if W10P3 == 2
			replace samesex10imp = 5 if W10P3 == 1
			label var samesex10imp "Importance of Sam Sex Attitude (W10)"
			label values samesex10imp importa
			su samesex10imp, meanonly
			gen samesex10imp01 = (samesex10imp - r(min))/(r(max)-r(min))
			label var samesex1imp01 "Importance of Same Sex Atittude (W10, 0-1)"


****Raising Taxes > 200,000*
	*Support = Dem position = High Values*
	***Wave 1***
		*Attitude*
			gen richtaxes1 = . 
			replace richtaxes1 = 1 if W1P4 == 2 & W1P_O_5 == 1 
			replace richtaxes1 = 2 if W1P4 == 2 & W1P_O_5 == 2
			replace richtaxes1 = 3 if W1P4 == 2 & W1P_O_5== 3
			replace richtaxes1 = 4 if W1P4 == 3
			replace richtaxes1 = 5 if W1P4 == 1 & W1P_F_5 == 3
			replace richtaxes1 = 6 if W1P4 == 1 & W1P_F_5 == 2
			replace richtaxes1 = 7 if W1P4 == 1 & W1P_F_5 == 1
			label var richtaxes1 "Supp./Opp. Raising Taxes > $200 (W1)"
			su richtaxes1, meanonly
			gen richtaxes101 = (richtaxes1 - r(min))/(r(max)-r(min))
			label var richtaxes101 "Supp./Opp. Raising Taxes > $200 (W1, 0-1)"
			label def support 1 "Oppose/Great Deal" 2 "Oppose/Moderately" 3 "Oppose/Little" 4 "Neither" 5 "Support/Little" 6 "Support/Moderately" 7 "Support/Great Deal"
			label values richtaxes1 support

		**Extremity***

			gen richtaxes1ext = .
			replace richtaxes1ext = 1 if richtaxes1 == 4
			replace richtaxes1ext = 2 if richtaxes1 == 3
			replace richtaxes1ext = 2 if richtaxes1 == 5
			replace richtaxes1ext = 3 if richtaxes1 == 2
			replace richtaxes1ext = 3 if richtaxes1 == 6
			replace richtaxes1ext = 4 if richtaxes1 == 1
			replace richtaxes1ext = 4 if richtaxes1 == 7
			label var richtaxes1ext "Extremity of Supp./Opp. Taxes (W1)"
			su richtaxes1ext, meanonly
			gen richtaxes1ext01 = (richtaxes1ext - r(min))/(r(max)-r(min))
			label var richtaxes1ext01 "Extremity of Supp./Opp. Taxes (W1, 0-1)"
			label values richtaxes1ext extreme

		**Importance**
			gen richtaxes1imp = .
			replace richtaxes1imp = 1 if W1P6 == 5
			replace richtaxes1imp = 2 if W1P6 == 4
			replace richtaxes1imp = 3 if W1P6 == 3
			replace richtaxes1imp = 4 if W1P6 == 2
			replace richtaxes1imp = 5 if W1P6 == 1
			label var richtaxes1imp "Importance of Taxes > $200 (W1)"
			label values richtaxes1imp importa
			su richtaxes1imp, meanonly
			gen richtaxes1imp01 = (richtaxes1imp - r(min))/(r(max)-r(min))
			label var richtaxes1imp01 "Importance of Taxes > $200 (W1, 0-1)"

	****Wave 10****
		*Attitude*
			gen richtaxes10 = . 
			replace richtaxes10 = 7 if W10P4 == 1 & W10P5_FA == 1 
			replace richtaxes10 = 6 if W10P4 == 1 & W10P5_FA == 2
			replace richtaxes10 = 5 if W10P4 == 1 & W10P5_FA == 3
			replace richtaxes10 = 4 if W10P4 == 3
			replace richtaxes10 = 3 if W10P4 == 2 & W10P5_OP == 3
			replace richtaxes10 = 2 if W10P4 == 2 & W10P5_OP == 2
			replace richtaxes10 = 1 if W10P4 == 2 & W10P5_OP == 1
			label var richtaxes10 "Supp./Opp. Raising Taxes > $200 (W10)"
			label values richtaxes10 support
			su richtaxes10, meanonly
			gen richtaxes1001 = (richtaxes10 - r(min))/(r(max)-r(min))
			label var richtaxes1001 "Supp./Opp. Raising Taxes > $200 (W10, 0-1)"

		*Extremity*
			gen richtaxes10ext = .
			replace richtaxes10ext = 1 if richtaxes10 == 4
			replace richtaxes10ext = 2 if richtaxes10 == 3
			replace richtaxes10ext = 2 if richtaxes10 == 5
			replace richtaxes10ext = 3 if richtaxes10 == 2
			replace richtaxes10ext = 3 if richtaxes10 == 6
			replace richtaxes10ext = 4 if richtaxes10 == 1
			replace richtaxes10ext = 4 if richtaxes10 == 7
			label var richtaxes10ext "Extremity of Supp./Opp. Taxes (W10)"
			su richtaxes10ext, meanonly
			gen richtaxes10ext01 = (richtaxes10ext - r(min))/(r(max)-r(min))
			label var richtaxes10ext01 "Extremity of Supp./Opp. Taxes (W10, 0-1)"
			label values richtaxes1ext extreme

		*Importance*
			gen richtaxes10imp = .
			replace richtaxes10imp = 1 if W10P6 == 5
			replace richtaxes10imp = 2 if W10P6 == 4
			replace richtaxes10imp = 3 if W10P6 == 3
			replace richtaxes10imp = 4 if W10P6 == 2
			replace richtaxes10imp = 5 if W10P6 == 1
			label var richtaxes10imp "Importance of Taxes > $200 (W10)"
			label values richtaxes10imp importa
			su richtaxes10imp, meanonly
			gen richtaxes10imp01 = (richtaxes10imp - r(min))/(r(max)-r(min))
			label var richtaxes10imp01 "Importance of Taxes > $200 (W10, 0-1)"



***Raising Taxes < 200,000*
		*Dem = Oppose = High*
		*Attitude*
			gen poortaxes1 = .
			replace poortaxes1 = 1 if W1P7 ==  1 & W1P_F_8 == 1
			replace poortaxes1 = 2 if W1P7 ==  1 & W1P_F_8 == 2
			replace poortaxes1 = 3 if W1P7 ==  1 & W1P_F_8 == 3
			replace poortaxes1 = 4 if W1P7 ==  3
			replace poortaxes1 = 5 if W1P7 ==  2 & W1P_O_8 == 3
			replace poortaxes1 = 6 if W1P7 ==  2 & W1P_O_8 == 2
			replace poortaxes1 = 7 if W1P7 ==  2 & W1P_O_8 == 1
			label var poortaxes1 "Favor/Oppose Raising Taxes on <$200 (W1)"
			label values poortaxes1 same
			su poortaxes1, meanonly
			gen poortaxes101 = (poortaxes1 - r(min))/(r(max)-r(min))
			label var poortaxes101 "Favor/Oppose Raising Taxes on <$200 (W1, 0-1)"

		*Extremity*
			gen poortaxes1ext = .
			replace poortaxes1ext = 1 if poortaxes1 == 4
			replace poortaxes1ext = 2 if poortaxes1 == 5
			replace poortaxes1ext = 2 if poortaxes1 == 3
			replace poortaxes1ext = 3 if poortaxes1 == 2
			replace poortaxes1ext = 3 if poortaxes1 == 6
			replace poortaxes1ext = 4 if poortaxes1 == 1
			replace poortaxes1ext = 4 if poortaxes1 == 7
			label var poortaxes1ext "Extremity of Taxes on <$200 Attitude (W1)"
			label values poortaxes1ext extreme
			su poortaxes1ext, meanonly
			gen poortaxes1ext01 = (poortaxes1ext - r(min))/(r(max)-r(min))
			label var poortaxes1ext01 "Extremity of Taxes on <$200 Attitude (W1, 0-1)"

		*Importance*
			gen poortaxes1imp = .
			replace poortaxes1imp = 1 if W1P9 == 5
			replace poortaxes1imp = 2 if W1P9 == 4
			replace poortaxes1imp = 3 if W1P9 == 3
			replace poortaxes1imp = 4 if W1P9 == 2
			replace poortaxes1imp = 5 if W1P9 == 1
			label values poortaxes1imp importa
			label var poortaxes1imp "Importance of <$200 Attitude (W1)"
			su poortaxes1imp, meanonly
			gen poortaxes1imp01 = (poortaxes1imp - r(min))/(r(max)-r(min))
			label var poortaxes1imp01 "Importance of <$200 Attitude (W1, 0-1)"


*****Prescription Drugs*
	*Dem position = support for paying for all drugs = coded as high*

	***Wave 1***

		*Attitude*
			gen drugs1 = . 
			replace drugs1 = 1 if W1P10 == 2 & W1P_O_11 == 1
			replace drugs1 = 2 if W1P10 == 2 & W1P_O_11 == 2
			replace drugs1 = 3 if W1P10 == 2 & W1P_O_11 == 3
			replace drugs1 = 4 if W1P10 == 3
			replace drugs1 = 5 if W1P10 == 1 & W1P_F_11 == 3
			replace drugs1 = 6 if W1P10 == 1 & W1P_F_11 == 2
			replace drugs1 = 7 if W1P10 == 1 & W1P_F_11 == 1
			label var drugs1 "Favor/Oppose Paying for Low Income Senior Drugs (W1)"
			label values drugs1 support
			su drugs1, meanonly
			gen drugs101 = (drugs1 - r(min))/(r(max)-r(min))
			label var drugs101 "Favor/Oppose Paying for Low Income Senior Drugs (W1, 0-1)"

		*Extremity**
			gen drugs1ext = .
			replace drugs1ext = 1 if drugs1 == 4
			replace drugs1ext = 2 if drugs1 == 5
			replace drugs1ext = 2 if drugs1 == 3
			replace drugs1ext = 3 if drugs1 == 2
			replace drugs1ext = 3 if drugs1 == 6
			replace drugs1ext = 4 if drugs1 == 1
			replace drugs1ext = 4 if drugs1 == 7
			label var drugs1ext "Extremity of Senior Drugs Attitude (W1)"
			label values drugs1ext extreme
			su drugs1ext, meanonly
			gen drugs1ext01 = (drugs1ext - r(min))/(r(max)-r(min))
			label var drugs1ext01 "Extremity of Senior Drugs Attitude (W1, 0-1)"

		*Importance*
			gen drugs1imp = .
			replace drugs1imp = 1 if W1P12 == 5
			replace drugs1imp = 2 if W1P12 == 4
			replace drugs1imp = 3 if W1P12 == 3
			replace drugs1imp = 4 if W1P12 == 2
			replace drugs1imp = 5 if W1P12 == 1
			label var drugs1imp "Importance of Senior Drugs Attitude (W1)"
			label values drugs1imp importa
			su drugs1imp, meanonly
			gen drugs1imp01 = (drugs1imp - r(min))/(r(max)-r(min))
			label var drugs1imp01 "Importance of Senior Drugs Attitude (W1, 0-1)"

	
	****Wave 10****
		*Attitude*
			gen drugs10 = .
			replace drugs10 = 1 if W10P10 == 2 & W10P11_O == 1
			replace drugs10 = 2 if W10P10 == 2 & W10P11_O == 2
			replace drugs10 = 3 if W10P10 == 2 & W10P11_O == 3
			replace drugs10 = 4 if W10P10 == 3
			replace drugs10 = 5 if W10P10 == 1 & W10P11_F == 3
			replace drugs10 = 6 if W10P10 == 1 & W10P11_F == 2
			replace drugs10 = 7 if W10P10 == 1 & W10P11_F == 1
			label var drugs10 "Favor/Oppose Paying for Low Income Senior Drugs (W10)"
			label values drugs10 support
			su drugs10, meanonly
			gen drugs1001 = (drugs10 - r(min))/(r(max)-r(min))
			label var drugs1001 "Favor/Oppose Paying for Low Income Senior Drugs (W10, 0-1)"

		*Extremity*
			gen drugs10ext = .
			replace drugs10ext = 1 if drugs10 == 4
			replace drugs10ext = 2 if drugs10 == 5
			replace drugs10ext = 2 if drugs10 == 3
			replace drugs10ext = 3 if drugs10 == 6
			replace drugs10ext = 3 if drugs10 == 2
			replace drugs10ext = 4 if drugs10 == 1
			replace drugs10ext = 4 if drugs10 == 7
			label var drugs10ext "Extremity of Senior Drugs Attitude (W10)"
			label values drugs10ext extreme
			su drugs10ext, meanonly
			gen drugs10ext01 = (drugs10ext - r(min))/(r(max)-r(min))
			label var drugs10ext01 "Extremity of Senior Drugs Attitude (W10, 0-1)"

		*Importance*
			gen drugs10imp = .
			replace drugs10imp = 1 if W10P12 == 5
			replace drugs10imp = 2 if W10P12 == 4
			replace drugs10imp = 3 if W10P12 == 3
			replace drugs10imp = 4 if W10P12 == 2
			replace drugs10imp = 5 if W10P12 == 1
			label var drugs10imp "Importance of Senior Drugs Attitude (W10)"
			label values drugs10imp importa
			su drugs10imp, meanonly
			gen drugs10imp01 = (drugs10imp - r(min))/(r(max)-r(min))
			label var drugs10imp01 "Importance of Senior Drugs Attitude (W10)"


*********Medical Care*
	****W1***
	*Dem position = support = high*

		*Attitude*
			gen medic1 = .
			replace medic1 = 1 if W1P13 == 2 & W1P_O_14 == 1
			replace medic1 = 2 if W1P13 == 2 & W1P_O_14 == 2
			replace medic1 = 3 if W1P13 == 2 & W1P_O_14 == 3
			replace medic1 = 4 if W1P13 == 3
			replace medic1 = 5 if W1P13 == 1 & W1P_F_14 == 3
			replace medic1 = 6 if W1P13 == 1 & W1P_F_14 == 2
			replace medic1 = 7 if W1P13 == 1 & W1P_F_14 == 1
			label var medic1 "Pay for All Nec. Medical Care (W1)"
			label values medic1 support
			su medic1, meanonly
			gen medic101 = (medic1 - r(min))/(r(max)-r(min))
			label var medic101 "Pay for All Nec. Medical Care (W1, 0-1)"

		*Extremity*
			gen medic1ext = . 
			replace medic1ext = 1 if medic1 == 4
			replace medic1ext = 2 if medic1 == 3
			replace medic1ext = 2 if medic1 == 5
			replace medic1ext = 3 if medic1 == 6
			replace medic1ext = 3 if medic1 == 2
			replace medic1ext = 4 if medic1 == 1
			replace medic1ext = 4 if medic1 == 7
			label var medic1ext "Extremity of Medical Care Attitude (W1)"
			su medic1ext, meanonly
			gen medic1ext01 = (medic1ext - r(min))/(r(max)-r(min))
			label var medic1ext01 "Extremity of Medical Care Attitude (W1, 0-1)"

		*Importance*
			gen medic1imp = .
			replace medic1imp = 1 if W1P15 == 5
			replace medic1imp = 2 if W1P15 == 4
			replace medic1imp = 3 if W1P15 == 3
			replace medic1imp = 4 if W1P15 == 2
			replace medic1imp = 5 if W1P15 == 1
			label var medic1imp "Importance of Medical Care Attitude (W1)"
			label values medic1imp importa
			su medic1imp, meanonly
			gen medic1imp01 = (medic1imp - r(min))/(r(max)-r(min))
			label var medic1imp01 "Importance of Medical Care Attitude (W1, 0-1)"

	*****Wave 10***
		**Attitude**
			gen medic10 = . 
			replace medic10 = 1 if W10P13 == 2 & W10P14_O == 1
			replace medic10 = 2 if W10P13 == 2 & W10P14_O == 2
			replace medic10 = 3 if W10P13 == 2 & W10P14_O == 3
			replace medic10 = 4 if W10P13 == 3
			replace medic10 = 5 if W10P13 == 1 & W10P14_F == 3
			replace medic10 = 6 if W10P13 == 1 & W10P14_F == 2
			replace medic10 = 7 if W10P13 == 1 & W10P14_F == 1
			label var medic10 "Pay for All Nec. Medical Care (W10)"
			label values medic10 support
			su medic10, meanonly
			gen medic1001 = (medic10 - r(min))/(r(max)-r(min))
			label var medic1001 "Pay for All Nec. Medical Care (W10, 0-1)"

		*Extremity*
			gen medic10ext = .
			replace medic10ext = 1 if medic10 == 4
			replace medic10ext = 2 if medic10 == 3
			replace medic10ext = 2 if medic10 == 5
			replace medic10ext = 3 if medic10 == 2
			replace medic10ext = 3 if medic10 == 6
			replace medic10ext = 4 if medic10 == 1
			replace medic10ext = 4 if medic10 == 7
			label var medic10ext "Extremity of Medical Care Attitude (W10)"
			su medic10ext, meanonly
			gen medic10ext01 = (medic10ext - r(min))/(r(max)-r(min))
			label var medic10ext01 "Extremity of Medical Care Attitude (W10, 0-1)"


		*Importance
			gen medic10imp = .
			replace medic10imp = 1 if W10P15 == 5
			replace medic10imp = 2 if W10P15 == 4
			replace medic10imp = 3 if W10P15 == 3
			replace medic10imp = 4 if W10P15 == 2
			replace medic10imp = 5 if W10P15 == 1
			label var medic10imp "Importance of Medical Care Attitude (W10)"
			label values medic10imp importa
			su medic10imp, meanonly
			gen medic10imp01 = (medic10imp - r(min))/(r(max)-r(min))
			label var medic10imp01 "Importance of Medical Care Attitude (W10, 0-1)"


****Habeas Corpus******
	*Dem position = oppose suspending habeas = higher*
	*W1
			*Attitude*
			gen habeas1 = .
			replace habeas1 = 1 if W1P16 == 1 & W1P_F_17 == 1
			replace habeas1 = 2 if W1P16 == 1 & W1P_F_17 == 2
			replace habeas1 = 3 if W1P16 == 1 & W1P_F_17 == 3
			replace habeas1 = 4 if W1P16 == 3
			replace habeas1 = 5 if W1P16 == 2 & W1P_O_17 == 3
			replace habeas1 = 6 if W1P16 == 2 & W1P_O_17 == 2
			replace habeas1 = 7 if W1P16 == 2 & W1P_O_17 == 1
			label var habeas "Suspend Habeas for Terror Suspects (W1)"
			label values habeas same
			su habeas1, meanonly
			gen habeas101 = (habeas1 - r(min))/(r(max)-r(min))
			label var habeas1 "Suspend Habeas for Terror Suspects (W1, 0-1)"

		**Extremity***
			gen habeas1ext = .
			replace habeas1ext = 1 if habeas1 == 4
			replace habeas1ext = 2 if habeas1 == 3
			replace habeas1ext = 2 if habeas1 == 5
			replace habeas1ext = 3 if habeas1 == 2
			replace habeas1ext = 3 if habeas1 == 6
			replace habeas1ext = 4 if habeas1 == 1
			replace habeas1ext = 4 if habeas1 == 7
			label var habeas1ext "Extremity of Habeas Attitude (W1)"
			label values habeas1ext extreme
			su habeas1ext, meanonly
			gen habeas1ext01 = (habeas1ext - r(min))/(r(max)-r(min))
			label var habeas1ext01 "Extremity of Habeas Attitude (W1, 0-1)"

		**Importance**
			gen habeas1imp = .
			replace habeas1imp = 1 if W1P18 == 5
			replace habeas1imp = 2 if W1P18 == 4
			replace habeas1imp = 3 if W1P18 == 3
			replace habeas1imp = 4 if W1P18 == 2
			replace habeas1imp = 5 if W1P18 == 1
			label var habeas1imp "Importance of Habeas Attitude (W1)"
			label values habeas1imp importa
			su habeas1imp, meanonly
			gen habeas1imp01 = (habeas1imp - r(min))/(r(max)-r(min))
			label var habeas1imp01 "Importance of Habeas Attitude (W1, 0-1)"

	*****Wave 10****
		*attitude*
			gen habeas10 = .
			replace habeas10 = 1 if W10P16 == 1 & W10P17_F == 1
			replace habeas10 = 2 if W10P16 == 1 & W10P17_F == 2
			replace habeas10 = 3 if W10P16 == 1 & W10P17_F == 3
			replace habeas10 = 4 if W10P16 == 3
			replace habeas10 = 5 if W10P16 == 2 & W10P17_O == 3
			replace habeas10 = 6 if W10P16 == 2 & W10P17_O == 2
			replace habeas10 = 7 if W10P16 == 2 & W10P17_O == 1
			label var habeas10 "Suspend Habeas for Terror Suspects (W10)"
			label values habeas10 same
			su habeas10, meanonly
			gen habeas1001 = (habeas10 - r(min))/(r(max)-r(min))
			label var habeas1001 "Suspend Habeas for Terror Suspects (W10, 0-1)"

		*Extremity*
			gen habeas10ext = .
			replace habeas10ext = 1 if habeas10 == 4
			replace habeas10ext = 2 if habeas10 == 3
			replace habeas10ext = 2 if habeas10 == 5
			replace habeas10ext = 3 if habeas10 == 2
			replace habeas10ext = 3 if habeas10 == 6
			replace habeas10ext = 4 if habeas10 == 1
			replace habeas10ext = 4 if habeas10 == 7
			label var habeas10ext "Extremity of Habeas Attitude (W10)"
			label values habeas10ext extreme
			su habeas10ext, meanonly
			gen habeas10ext01 = (habeas10ext - r(min))/(r(max)-r(min))
			label var habeas10ext01 "Extremity of Habeas Attitude (W10, 0-1)"

		*Importance*
			gen habeas10imp = .
			replace habeas10imp = 1 if W10P18 == 5
			replace habeas10imp = 2 if W10P18 == 4
			replace habeas10imp = 3 if W10P18 == 3
			replace habeas10imp = 4 if W10P18 == 2
			replace habeas10imp = 5 if W10P18 == 1
			label var habeas10imp "Importance of Habeas Attitude (W10)"
			label values habeas10imp importa
			su habeas10imp, meanonly
			gen habeas10imp01 = (habeas10imp - r(min))/(r(max)-r(min))
			label var habeas10imp01 "Importance of Habeas Attitude (W10, 0-1)"


*************Phone Tapping*
	*Dem position = favor = coded high*

	*****Wave 1***
		*Attitude***
			gen phone1 = .
			replace phone1 = 1 if W1P19 == 2 & W1P_O_20 == 1
			replace phone1 = 2 if W1P19 == 2 & W1P_O_20 == 2
			replace phone1 = 3 if W1P19 == 2 & W1P_O_20 == 3
			replace phone1 = 4 if W1P19 == 3
			replace phone1 = 5 if W1P19 == 1 & W1P_F_20 == 3
			replace phone1 = 6 if W1P19 == 1 & W1P_F_20 == 2
			replace phone1 = 7 if W1P19 == 1 & W1P_F_20 == 1
			label var phone1 "Court Order to Phone Tap Terror Suspects (W1)"
			label values phone1 support
			su phone1, meanonly
			gen phone101 = (phone1 - r(min))/(r(max)-r(min))
			label var phone101 "Court Order to Phone Tap Terror Suspects (W1, 0-1)"


		**Extremity**
			gen phone1ext = .
			replace phone1ext = 1 if phone1 == 4
			replace phone1ext = 2 if phone1 == 3
			replace phone1ext = 2 if phone1 == 5
			replace phone1ext = 3 if phone1 == 2
			replace phone1ext = 3 if phone1 == 6
			replace phone1ext = 4 if phone1 == 1
			replace phone1ext = 4 if phone1 == 7
			label var phone1ext "Extremity of Phone Tap Attitude (W1)"
			label values phone1ext extreme
			su phone1ext, meanonly
			gen phone1ext01 = (phone1ext - r(min))/(r(max)-r(min))
			label var phone1ext01 "Extremity of Phone Tap Attitude (W1)"

		*Importance*
		gen phone1imp = .
		replace phone1imp = 1 if W1P21 == 5
		replace phone1imp = 2 if W1P21 == 4
		replace phone1imp = 3 if W1P21 == 3
		replace phone1imp = 4 if W1P21 == 2
		replace phone1imp = 5 if W1P21 == 1
		label var phone1imp "Importance of Phone Tap Attitude (W1)"
		label values phone1imp importa
		su phone1imp, meanonly
		gen phone1imp01 = (phone1imp - r(min))/(r(max)-r(min))
		label var phone1imp01 "Importance of Phone Tap Attitude (W1, 0-1)"


	******Wave 10***
		**attitude*
			gen phone10 = .
			replace phone10 = 1 if W10P19 == 2 & W10P20_O == 1
			replace phone10 = 2 if W10P19 == 2 & W10P20_O == 2
			replace phone10 = 3 if W10P19 == 2 & W10P20_O == 3
			replace phone10 = 4 if W10P19 == 3
			replace phone10 = 5 if W10P19 == 1 & W10P20_F == 3
			replace phone10 = 6 if W10P19 == 1 & W10P20_F == 2
			replace phone10 = 7 if W10P19 == 1 & W10P20_F == 1
			label var phone10 "Court Order to Phone Tap Terror Suspects (W10)"
			label values phone10 support
			su phone10, meanonly
			gen phone1001 = (phone10 - r(min))/(r(max)-r(min))
			label var phone1001 "Court Order to Phone Tap Terror Suspects (W10, 0-1)"

		***Extremity**
			gen phone10ext = .
			replace phone10ext = 1 if phone10 == 4
			replace phone10ext = 2 if phone10 == 5
			replace phone10ext = 2 if phone10 == 3
			replace phone10ext = 3 if phone10 == 2
			replace phone10ext = 3 if phone10 == 6
			replace phone10ext = 4 if phone10 == 1
			replace phone10ext = 4 if phone10 == 7
			label var phone10ext "Extremity of Phone Tap Attitude (W10)"
			label values phone10ext extreme
			su phone10ext, meanonly
			gen phone10ext01 = (phone10ext - r(min))/(r(max)-r(min))
			label var phone10ext01 "Extremity of Phone Tap Attitude (W10,0-1)"

		**Importance***
			gen phone10imp = .
			replace phone10imp = 1 if W10P21 == 5
			replace phone10imp = 2 if W10P21 == 4
			replace phone10imp = 3 if W10P21 == 3
			replace phone10imp = 4 if W10P21 == 2
			replace phone10imp = 5 if W10P21 == 1
			label var phone10imp "Importance of Phone Tap Attitude (W10)"
			label values phone10imp importa
			su phone10imp, meanonly
			gen phone10imp01 = (phone10imp - r(min))/(r(max)-r(min))
			label var phone10imp01 "Importance of Phone Tap Attitude (W10, 0-1)"



********Illegal Immigrants working
	*Dem = support? = high*
	****Wave 1***
		**Attitude**
			gen illeg1 = .
			replace illeg1 = 1 if W1P22 == 2 & W1P_O_23 == 1
			replace illeg1 = 2 if W1P22 == 2 & W1P_O_23 == 2
			replace illeg1 = 3 if W1P22 == 2 & W1P_O_23 == 3
			replace illeg1 = 4 if W1P22 == 3
			replace illeg1 = 5 if W1P22 == 1 & W1P_F_23 == 3
			replace illeg1 = 6 if W1P22 == 1 & W1P_F_23 == 2
			replace illeg1 = 7 if W1P22 == 1 & W1P_F_23 == 1
			label var illeg1 "Allow Ill. Immigrants to Work for 3 Years (W1)"
			label values illeg1 support
			su illeg1, meanonly
			gen illeg101 = (illeg1 - r(min))/(r(max)-r(min))
			label var illeg101 "Allow Ill. Immigrants to Work for 3 Years (W1, 0-1)"

		*Extremity*
			gen illeg1ext = . 
			replace illeg1ext = 1 if illeg1 == 4
			replace illeg1ext = 2 if illeg1 == 5
			replace illeg1ext = 2 if illeg1 == 3
			replace illeg1ext = 3 if illeg1 == 6
			replace illeg1ext = 3 if illeg1 == 2
			replace illeg1ext = 4 if illeg1 == 1
			replace illeg1ext = 4 if illeg1 == 7
			label var illeg1ext "Extremity of Ill. Immigrants Working Attitude (W1)"
			label values illeg1ext extreme
			su illeg1ext, meanonly
			gen illeg1ext01 = (illeg1ext - r(min))/(r(max)-r(min))
			label var illeg1ext01 "Extremity of Ill. Immigrants Working Attitude (W1, 0-1)"
			
		*Importance**
			gen illeg1imp = .
			replace illeg1imp = 1 if W1P24 == 5
			replace illeg1imp = 2 if W1P24 == 4
			replace illeg1imp = 3 if W1P24 == 3
			replace illeg1imp = 4 if W1P24 == 2
			replace illeg1imp = 5 if W1P24 == 1
			label var illeg1imp "Importance of Ill. Immigrants Working Attitude (W1)"
			label values illeg1imp importa
			su illeg1imp, meanonly
			gen illeg1imp01 = (illeg1imp - r(min))/(r(max)-r(min))
			label var illeg1imp01 "Importance of Ill. Immigrants Working Attitude (W1, 0-1)"

		**Wave 10**
		*attitude*
			gen illeg10 = .
			replace illeg10 = 1 if W10P22 == 2 & W10P23_O == 1
			replace illeg10 = 2 if W10P22 == 2 & W10P23_O == 2
			replace illeg10 = 3 if W10P22 == 2 & W10P23_O == 3
			replace illeg10 = 4 if W10P22 == 3
			replace illeg10 = 5 if W10P22 == 1 & W10P23_F == 3
			replace illeg10 = 6 if W10P22 == 1 & W10P23_F == 2
			replace illeg10 = 7 if W10P22 == 1 & W10P23_F == 1
			label var illeg10 "Allow Ill. Immigrants to Work for 3 Years (W10)"
			label values illeg10 support
			su illeg10, meanonly
			gen illeg1001 = (illeg10 - r(min))/(r(max)-r(min))
			label var illeg1001 "Allow Ill. Immigrants to Work for 3 Years (W10, 0-1)"

		*Extremity*
			gen illeg10ext = .
			replace illeg10ext = 1 if illeg10 == 4
			replace illeg10ext = 2 if illeg10 == 3
			replace illeg10ext = 2 if illeg10 == 5
			replace illeg10ext = 3 if illeg10 == 2
			replace illeg10ext = 3 if illeg10 == 6
			replace illeg10ext = 4 if illeg10 == 1
			replace illeg10ext = 4 if illeg10 == 7
			label var illeg10ext "Extremity of Ill. Immigrants Working Attitude (W10)"
			label values illeg10ext extreme
			su illeg10ext, meanonly
			gen illeg10ext01 = (illeg10ext - r(min))/(r(max)-r(min))
			label var illeg10ext01 "Extremity of Ill. Immigrants Working Attitude (W10, 0-1)"

		*importance*
			gen illeg10imp = .
			replace illeg10imp = 1 if W10P24 == 5
			replace illeg10imp = 2 if W10P24 == 4
			replace illeg10imp = 3 if W10P24 == 3
			replace illeg10imp = 4 if W10P24 == 2
			replace illeg10imp = 5 if W10P24 == 1
			label var illeg10imp "Importance of Ill. Immigrants Working Attitude (W10)"
			label values illeg10imp importa
			su illeg10imp, meanonly
			gen illeg10imp01 = (illeg10imp - r(min))/(r(max)-r(min))
			label var illeg10imp01 "Importance of Ill. Immigrants Working Attitude (W10, 0-1)"



***********Path to citizenship*
	*Dem position = support = coded high*

	****Wave 1***
		*attitude*
			gen path1 = . 
			replace path1 = 1 if W1P25 == 2 & W1P_O_26 == 1
			replace path1 = 2 if W1P25 == 2 & W1P_O_26 == 2
			replace path1 = 3 if W1P25 == 2 & W1P_O_26 == 3
			replace path1 = 4 if W1P25 == 3
			replace path1 = 5 if W1P25 == 1 & W1P_F_26 == 3
			replace path1 = 6 if W1P25 == 1 & W1P_F_26 == 2
			replace path1 = 7 if W1P25 == 1 & W1P_F_26 == 1
			label var path1 "Pathway to Citizenship (W1)"
			label values path1 support
			su path1, meanonly
			gen path101 = (path1 - r(min))/(r(max)-r(min))
			label var path101 "Pathway to Citizenship (W1, 0-1)"

		*Extremity*
			gen path1ext = .
			replace path1ext = 1 if path1 == 4
			replace path1ext = 2 if path1 == 3
			replace path1ext = 2 if path1 == 5
			replace path1ext = 3 if path1 == 2
			replace path1ext = 3 if path1 == 6
			replace path1ext = 4 if path1 == 1
			replace path1ext = 4 if path1 == 7
			label var path1ext "Extremity of Pathway to Citizenship Attitude (W1)"
			label values path1ext extreme
			su path1ext, meanonly
			gen path1ext01 = (path1ext - r(min))/(r(max)-r(min))
			label var path1ext01 "Extremity of Pathway to Citizenship Attitude (W1, 0-1)"

		*Importance*
			gen path1imp = .
			replace path1imp = 1 if W1P27 == 5
			replace path1imp = 2 if W1P27 == 4
			replace path1imp = 3 if W1P27 == 3
			replace path1imp = 4 if W1P27 == 2
			replace path1imp = 5 if W1P27 == 1
			label var path1imp "Importance of Pathway to Citizenship Att. (W1)"
			label values path1imp importa
			su path1imp, meanonly
			gen path1imp01 = (path1imp - r(min))/(r(max)-r(min))
			label var path1imp01 "Importance of Pathway to Citizenship Att. (W1, 0-1)"
	
	**Wave 10*

		*attitude*
			gen path10 = .
			replace path10 = 1 if W10P25 == 2 & W10P26_O == 1
			replace path10 = 2 if W10P25 == 2 & W10P26_O == 2
			replace path10 = 3 if W10P25 == 2 & W10P26_O == 3
			replace path10 = 4 if W10P25 == 3
			replace path10 = 5 if W10P25 == 1 & W10P26_F == 3
			replace path10 = 6 if W10P25 == 1 & W10P26_F == 2
			replace path10 = 7 if W10P25 == 1 & W10P26_F == 1
			label var path10 "Pathway to Citizenship (W10)"
			label values path10 support
			su path10, meanonly
			gen path1001 = (path10 - r(min))/(r(max)-r(min))
			label var path1001 "Pathway to Citizenship (W10, 0-1)"

		*Extremity**
			gen path10ext = .
			replace path10ext = 1 if path10 == 4
			replace path10ext = 2 if path10 == 3
			replace path10ext = 2 if path10 == 5
			replace path10ext = 3 if path10 == 2
			replace path10ext = 3 if path10 == 6
			replace path10ext = 4 if path10 == 1
			replace path10ext = 4 if path10 == 7
			label var path10ext "Extremity of Pathway to Citizenship Attitude (W10)"
			label values path10ext extreme
			su path10ext, meanonly
			gen path10ext01 = (path10ext - r(min))/(r(max)-r(min))
			label var path10ext01 "Extremity of Pathway to Citizenship Attitude (W10, 0-1)"

		**Importance**
			gen path10imp = .
			replace path10imp = 1 if W10P27 == 5
			replace path10imp = 2 if W10P27 == 4
			replace path10imp = 3 if W10P27 == 3
			replace path10imp = 4 if W10P27 == 2
			replace path10imp = 5 if W10P27 == 1
			label var path10imp "Importance of Pathway to Citizenship Attitude (W10)"
			label values path10imp importa
			su path10imp, meanonly
			gen path10imp01 = (path10imp - r(min))/(r(max)-r(min))
			label var path10imp01 "Importance of Pathway to Citizenship Attitude (W10, 0-1)"

			
	
				*****Control Variables*****
*PID
	gen pid10 = . 
	replace pid10 = 1 if DER08W10 == 0
	replace pid10 = 2 if DER08W10 == 1
	replace pid10 = 3 if DER08W10 == 2
	replace pid10 = 4 if DER08W10 == 3
	replace pid10 = 5 if DER08W10 == 4
	replace pid10 = 6 if DER08W10 == 5
	replace pid10 = 7 if DER08W10 == 6
	label var pid10 "PID (W10)"
	label def pid 1 "Str. Dem" 2 "Not Str. Dem" 3 "Ind. Dem" 4 "Ind." 5 "Ind. Rep" 6 "Not Str. Rep" 7 "St. Rep"
	label values pid10 pid
	
	gen pid9 = . 
	replace pid9 = 1 if DER08W9 == 0
	replace pid9 = 2 if DER08W9 == 1
	replace pid9 = 3 if DER08W9 == 2
	replace pid9 = 4 if DER08W9 == 3
	replace pid9 = 5 if DER08W9 == 4
	replace pid9 = 6 if DER08W9 == 5
	replace pid9 = 7 if DER08W9 == 6
	label var pid9 "PID (W9)"
	label values pid9 pid

*Ideology
		gen ideology10 = DER09W10
		replace ideology10 = . if ideology10 == -7
		replace ideology10 = . if ideology10 == -6
		replace ideology10 = . if ideology10 == -4
		replace ideology10 = . if ideology10 == -5
		label var ideology10 "Ideology (W10)"
		label def ideo 1 "Ext. Liberal" 2 "Liberal" 3 "Slightly Lib." 4 "Moderate" 5 "Slightly Cons." 6 "Cons." 7 "Ext. Cons."
		label values ideology10 ideo


*Interest
	gen interest10 = .
	replace interest10 = 1 if W10H1 == 5
	replace interest10 = 2 if W10H1 == 4
	replace interest10 = 3 if W10H1 == 3
	replace interest10 = 4 if W10H1 == 2
	replace interest10 = 5 if W10H1 == 1
	label var interest10 "R's Interest in Pol (W10)"
	label def inter 1 "Not Interested at All" 2 "Slightly Interested" 3 "Moderately Interested" 4 "Very Interested" 5 "Extremely Interested"
	label values interest10 inter


*Gender
	gen gender = . 
	replace gender = 1 if DER01 == 2
	replace gender = 0 if DER01 == 1
	label var gender "R's Gender"
	label def gend 1 "Female" 0 "Male"
	label values gender gend

*Age
	gen age = DER02
	label var age "R's Age on Election Day"

*Income
	rename DER06 income
	replace income = . if income == -6
	replace income = . if income == -2

*Education
	gen educ = .
	replace educ = 1  if DER05 == 1
	replace educ = 2  if DER05 == 2
	replace educ = 3  if DER05 == 3
	replace educ = 4  if DER05 == 4
	replace educ = 4  if DER05 == 5
	label var educ "R's Education"
	label def edu 1 "No HS" 2 "HS" 3 "Some College" 4 "BA+"
	label values educ edu

*Race
	rename DER04 race
						
				
				
*Avg. Tie Strength in Network**
	label def clos 1 "Not Close At All" 2 "Slightly Close" 3 "Moderately Close" 4 "Very Close" 5 "Extremely Close"
	gen close1 = . 
	replace close1 = 1 if W9ZD4_1 == 5
	replace close1 = 2 if W9ZD4_1 == 4
	replace close1 = 3 if W9ZD4_1 == 3
	replace close1 = 4 if W9ZD4_1 == 2
	replace close1 = 5 if W9ZD4_1 == 1
	label var close1 "Tie Closeness - Discussant 1"
	label values close1 clos
	tab close1 W9ZD4_1
	
	
	gen close2 = . 
	replace close2 = 1 if W9ZD4_2 == 5
	replace close2 = 2 if W9ZD4_2 == 4
	replace close2 = 3 if W9ZD4_2 == 3
	replace close2 = 4 if W9ZD4_2 == 2
	replace close2 = 5 if W9ZD4_2 == 1
	label var close2 "Tie Closeness - Discussant 2"
	label values close2 clos
	tab close2 W9ZD4_2
	
	
	gen close3 = . 
	replace close3 = 1 if W9ZD4_3 == 5
	replace close3 = 2 if W9ZD4_3 == 4
	replace close3 = 3 if W9ZD4_3 == 3
	replace close3 = 4 if W9ZD4_3 == 2
	replace close3 = 5 if W9ZD4_3 == 1
	label var close3 "Tie Closeness - Discussant 3"
	label values close3 clos
	tab close3 W9ZD4_3
	
	egen network_close = rowmean(close1 close2 close3)
	label var network_close "Avg. Closeness with Network Ties"

*Avg. Discussant Interest in Politics
	label def discinterest 1 "Not at all" 2 "Slightly" 3 "Moderately" 4 "Very" 5 "Extremely"
	gen interestd1 = .
	replace interestd1 = 1 if W9ZD17_1 == 5
	replace interestd1 = 2 if W9ZD17_1 == 4
	replace interestd1 = 3 if W9ZD17_1 == 3
	replace interestd1 = 4 if W9ZD17_1 == 2
	replace interestd1 = 5 if W9ZD17_1 == 1		
	label var interestd1 "Disc. 1 Interest Level"
	label values interestd1 discinterest 
	tab interestd1 W9ZD17_1		
				
	gen interestd2 = .
	replace interestd2 = 1 if W9ZD17_2 == 5
	replace interestd2 = 2 if W9ZD17_2 == 4
	replace interestd2 = 3 if W9ZD17_2 == 3
	replace interestd2 = 4 if W9ZD17_2 == 2
	replace interestd2 = 5 if W9ZD17_2 == 1		
	label var interestd2 "Disc. 2 Interest Level"
	label values interestd2 discinterest 			
	tab interestd2 W9ZD17_2		

	gen interestd3 = .
	replace interestd3 = 1 if W9ZD17_3 == 5
	replace interestd3 = 2 if W9ZD17_3 == 4
	replace interestd3 = 3 if W9ZD17_3 == 3
	replace interestd3 = 4 if W9ZD17_3 == 2
	replace interestd3 = 5 if W9ZD17_3 == 1		
	label var interestd3 "Disc. 3 Interest Level"
	label values interestd3 discinterest 
	tab interestd3 W9ZD17_3		
	
	summ interestd1-interestd3
	
	egen network_interest = rowmean(interestd1 interestd2 interestd3)
	label var network_interest "Average Interest in Network"
	
*Network Education
	label def educdisc 1 "< HS" 2 "HS" 3 "Some College" 4 "BA+"
	gen educd1 = . 
	replace educd1 = 1  if W9ZD23_1 >=1 & W9ZD23_1 <=8
	replace educd1 = 2 if W9ZD23_1 == 9
	replace educd1 = 3  if W9ZD23_1 >= 10 & W9ZD23_1 <=11
	replace educd1 = 4 if W9ZD23_1 >=12 & W9ZD23_1 <=14
	label var educd1 "D1 Education Level"
	label values educd1 educdisc
	
	gen educd2 = . 
	replace educd2 = 1  if W9ZD23_2 >=1 & W9ZD23_2 <=8
	replace educd2 = 2 if W9ZD23_2 == 9
	replace educd2 = 3  if W9ZD23_2 >= 10 & W9ZD23_2 <=11
	replace educd2 = 4 if W9ZD23_2 >=12 & W9ZD23_2 <=14
	label var educd2 "D2 Education Level"
	label values educd2 educdisc
	
	gen educd3 = . 
	replace educd3 = 1  if W9ZD23_3 >=1 & W9ZD23_3 <=8
	replace educd3 = 2 if W9ZD23_3 == 9
	replace educd3 = 3  if W9ZD23_3 >= 10 & W9ZD23_3 <=11
	replace educd3 = 4 if W9ZD23_3 >=12 & W9ZD23_3 <=14
	label var educd3 "D3 Education Level"
	label values educd3 educdisc
	
	egen network_educ = rowmean(educd1 educd2 educd3)
	label var network_educ "Ed. Level of Network"
	
*Racial Heterogeneity in network
	*the procedure was as follows: first code teh respondent's racial classification variable
	*then the discussants
	*then whether there is a difference between discussant and respondent
	*and then the combined measure at the end
	label def racefull 1 "White" 2 "Black" 3 "Am. Indian" 4 "Alaska Native" 5 "Asian" 6 "Native Hawaiian" 7 "Pacific Islander" 8 "Other" 9 "Hispanic"
	gen race_full = 1 if rracewhi == 1 &  rhisp == 2
	replace race_full = 2 if rracebla == 1 & rhisp == 2
	replace race_full = 3 if rraceami == 1 & rhisp == 2
	replace race_full = 4  if rraceala == 1 & rhisp == 2
	replace race_full = 5  if rraceasi == 1 & rhisp == 2
	replace race_full = 6  if rracehaw == 1 & rhisp == 2
	replace race_full = 7  if rracepac == 1 & rhisp == 2
	replace race_full = 8  if rraceoth == 1 & rhisp == 2
	replace race_full = 9 if rracebla == 1 & rhisp == 1
	replace race_full = 9 if rraceami == 1 & rhisp == 1
	replace race_full = 9  if rraceala == 1 & rhisp == 1
	replace race_full = 9  if rraceasi == 1 & rhisp == 1
	replace race_full = 9  if rracehaw == 1 & rhisp == 1
	replace race_full = 9  if rracepac == 1 & rhisp == 1
	replace race_full = 9  if rraceoth == 1 & rhisp == 1
	label values race_full racefull
	
	*NOTE: ALASKA NATIVE AND AMERICAN INDIAN ARE COMBINED*
	label def racefull1 1 "White" 2 "Black" 3 "Am. Indian & Alaska Native" 4 "Asian" 5 "Native Hawaiian" 6 "Pacific Islander" 7 "Other" 8 "Hispanic"
	gen race_fulld1 = . 
	replace race_fulld1 = 1 if W9ZD22_1 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 2 if W9ZD22_2 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 3 if W9ZD22_3 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_4 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_5 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_6 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_7 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_8 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD22_9 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 4 if W9ZD2_10 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 5 if W9ZD2_11 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 6 if W9ZD2_12 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 6 if W9ZD2_13 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 6 if W9ZD2_14 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 7 if W9ZD2_15 == 1 & W9ZD21_1 == 2
	replace race_fulld1 = 8 if W9ZD22_1 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_2 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_3 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_4 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_5 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_6 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_7 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_8 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD22_9 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_10 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_11 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_12 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_13 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_14 == 1 & W9ZD21_1 == 1
	replace race_fulld1 = 8 if W9ZD2_15 == 1 & W9ZD21_1 == 1
	label var race_fulld1 "D1 Race"
	label values race_fulld1 racefull1

		gen race_fulld2 = . 
	replace race_fulld2 = 1 if W9ZD2_17 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 2 if W9ZD2_18 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 3 if W9ZD2_19 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_20 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_21 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_22 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_23 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_24 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_25 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 4 if W9ZD2_26 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 5 if W9ZD2_27 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 6 if W9ZD2_28 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 6 if W9ZD2_29 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 6 if W9ZD2_30 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 7 if W9ZD2_31 == 1 & W9ZD21_2 == 2
	replace race_fulld2 = 8 if W9ZD2_17 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_18 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_19 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_20 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_21 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_22 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_23 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_24 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_25 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_26 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_27 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_28 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_29 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_30 == 1 & W9ZD21_2 == 1
	replace race_fulld2 = 8 if W9ZD2_31 == 1 & W9ZD21_2 == 1
	label var race_fulld2 "D2 Race"
	label values race_fulld2 racefull1
	
	
		gen race_fulld3 = . 
	replace race_fulld3 = 1 if W9ZD2_33 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 2 if W9ZD2_34 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 3 if W9ZD2_35 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_36 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_37 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_38 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_39 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_40 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_41 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 4 if W9ZD2_42 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 5 if W9ZD2_43 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 6 if W9ZD2_44 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 6 if W9ZD2_45 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 6 if W9ZD2_46 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 7 if W9ZD2_47 == 1 & W9ZD21_3 == 2
	replace race_fulld3 = 8 if W9ZD2_33 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_34 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_35 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_36 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_37 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_38 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_39 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_40 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_41 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_42 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_43 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_44 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_45 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_46 == 1 & W9ZD21_3 == 1
	replace race_fulld3 = 8 if W9ZD2_47 == 1 & W9ZD21_3 == 1
	label var race_fulld3 "D3 Race"
	label values race_fulld3 racefull1
	
	label def racediff 1 "Different Race" 0 "Same Race"
	gen race1_diff = . 
	replace race1_diff = 1 if race_full == 1 & race_fulld1 !=1 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 1 & race_fulld1 == 1	
	replace race1_diff = 1 if race_full == 2 & race_fulld1 !=2 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 2 & race_fulld1 == 2
	replace race1_diff = 1 if race_full == 3 & race_fulld1 !=3 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 3 & race_fulld1 == 3
	replace race1_diff = 1 if race_full == 4 & race_fulld1 !=3 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 4 & race_fulld1 == 3	
	replace race1_diff = 1 if race_full == 5 & race_fulld1 !=4 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 5 & race_fulld1 == 4		
	replace race1_diff = 1 if race_full == 6 & race_fulld1 !=5 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 6 & race_fulld1 == 5	
	replace race1_diff = 1 if race_full == 7 & race_fulld1 !=6 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 7 & race_fulld1 == 6
	replace race1_diff = 1 if race_full == 8 & race_fulld1 !=7 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 8 & race_fulld1 == 7
	replace race1_diff = 1 if race_full == 9 & race_fulld1 !=8 & race_fulld1 !=.
	replace race1_diff = 0 if race_full == 9 & race_fulld1 == 8
	label var race1_diff "D1 is Diff Race"
	label values race1_diff racediff
	
	gen race2_diff = . 
	replace race2_diff = 1 if race_full == 1 & race_fulld2 !=1 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 1 & race_fulld2 == 1	
	replace race2_diff = 1 if race_full == 2 & race_fulld2 !=2 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 2 & race_fulld2 == 2
	replace race2_diff = 1 if race_full == 3 & race_fulld2 !=3 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 3 & race_fulld2 == 3
	replace race2_diff = 1 if race_full == 4 & race_fulld2 !=3 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 4 & race_fulld2 == 3	
	replace race2_diff = 1 if race_full == 5 & race_fulld2 !=4 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 5 & race_fulld2 == 4		
	replace race2_diff = 1 if race_full == 6 & race_fulld2 !=5 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 6 & race_fulld2 == 5	
	replace race2_diff = 1 if race_full == 7 & race_fulld2 !=6 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 7 & race_fulld2 == 6
	replace race2_diff = 1 if race_full == 8 & race_fulld2 !=7 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 8 & race_fulld2 == 7
	replace race2_diff = 1 if race_full == 9 & race_fulld2 !=8 & race_fulld2 !=.
	replace race2_diff = 0 if race_full == 9 & race_fulld2 == 8
	label var race2_diff "D2 is Diff Race"
	label values race2_diff racediff
	
	gen race3_diff = . 
	replace race3_diff = 1 if race_full == 1 & race_fulld3 !=1 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 1 & race_fulld3 == 1	
	replace race3_diff = 1 if race_full == 2 & race_fulld3 !=2 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 2 & race_fulld3 == 2
	replace race3_diff = 1 if race_full == 3 & race_fulld3 !=3 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 3 & race_fulld3 == 3
	replace race3_diff = 1 if race_full == 4 & race_fulld3 !=3 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 4 & race_fulld3 == 3	
	replace race3_diff = 1 if race_full == 5 & race_fulld3 !=4 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 5 & race_fulld3 == 4		
	replace race3_diff = 1 if race_full == 6 & race_fulld3 !=5 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 6 & race_fulld3 == 5	
	replace race3_diff = 1 if race_full == 7 & race_fulld3 !=6 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 7 & race_fulld3 == 6
	replace race3_diff = 1 if race_full == 8 & race_fulld3 !=7 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 8 & race_fulld3 == 7
	replace race3_diff = 1 if race_full == 9 & race_fulld3 !=8 & race_fulld3 !=.
	replace race3_diff = 0 if race_full == 9 & race_fulld3 == 8
	label var race3_diff "D3 is Diff Race"
	label values race3_diff racediff
	
	egen race_network = rowmean(race1_diff race2_diff race3_diff)
	label var race_network "Network Racial Heterogeneity"

	
*Gender Heterogeneity in network*	
	*discussants were first coded as to whether they had the same sex
	*then this combined index was subtracted from 1 to reverse the direction of the variable
		label def sexsam 1 "Same Gender as Discussant" 0 "Diff. Gender as Discussant"
	
		gen sexsame1 = . 
		replace sexsame1 = 1 if gender ==  0 & W9ZD7_1 == 1
		replace sexsame1 = 1 if gender ==  1 & W9ZD7_1 == 2
		replace sexsame1 = 0 if gender ==  0 & W9ZD7_1 == 2
		replace sexsame1 = 0 if gender ==  1 & W9ZD7_1 == 1
		label var sexsame1 "Same Gender as Discussant?"
		label values sexsame1 sexsam

		
		gen sexsame2 = . 
		replace sexsame2 = 1 if gender ==  0 & W9ZD7_2 == 1
		replace sexsame2 = 1 if gender ==  1 & W9ZD7_2 == 2
		replace sexsame2 = 0 if gender ==  0 & W9ZD7_2 == 2
		replace sexsame2 = 0 if gender ==  1 & W9ZD7_2 == 1
		label var sexsame2 "Same Gender as Discussant?"
		label values sexsame2 sexsam
		
		gen sexsame3 = . 
		replace sexsame3 = 1 if gender ==  0 & W9ZD7_3 == 1
		replace sexsame3 = 1 if gender ==  1 & W9ZD7_3 == 2
		replace sexsame3 = 0 if gender ==  0 & W9ZD7_3 == 2
		replace sexsame3 = 0 if gender ==  1 & W9ZD7_3 == 1
		label var sexsame3 "Same Gender as Discussant?"
		label values sexsame3 sexsam
	
		egen network_sexsame = rowmean(sexsame1 sexsame2 sexsame3)
	
		gen network_genderh = abs(1 - network_sexsame)
		label var network_genderh "Gender Heterogeneity"
		summarize network_genderh

		
*Religious Heterogeneity in Network
	label def samerelig 0 "Same Denomination" 1 "Different Denomination"
	gen denom1 = . 
	replace denom1 = 0 if W9ZD19_1 == 1
	replace denom1 = 1 if W9ZD19_1 == 2
	label var denom1 "D1 Shares Denomination?"
	label values denom1 samerelig
	
	gen denom2 = . 
	replace denom2 = 0 if W9ZD19_2 == 1
	replace denom2 = 1 if W9ZD19_2 == 2
	label var denom2 "D2 Shares Denomination?"
	label values denom2 samerelig
	
	gen denom3 = . 
	replace denom3 = 0 if W9ZD19_3 == 1
	replace denom3 = 1 if W9ZD19_3 == 2
	label var denom3 "D3 Shares Denomination?"
	label values denom3 samerelig
	
	tab denom1
	tab denom2
	tab denom3
	
	egen network_denom = rowmean(denom1 denom2 denom3)
	label var network_denom "Religious Heterogeneity"
	summ network_denom
	tab network_denom
	
*Network Size
		gen network_size = .
		replace network_size = DER17 if W9ZD1 == 1 & DER17 >=0 & DER17 <=8
		replace network_size = 0 if W9ZD1 == 2
		label var network_size "Network Size"
		summarize network_size 

		
		
		
					***************Disagreement*****************
*General disagreement
	label def gendifference 1 "Not Different at All" 2 "Slightly Different" 3 "Moderately Different" 4 "Very Different" 5 "Extremely Different"
	gen gendiff1 = . 
	replace gendiff1 = 1 if W9ZD9_1 == 5
	replace gendiff1 = 2 if W9ZD9_1 == 4
	replace gendiff1 = 3 if W9ZD9_1 == 3
	replace gendiff1 = 4 if W9ZD9_1 == 2
	replace gendiff1 = 5 if W9ZD9_1 == 1
	label var gendiff1 "General Difference with Disc. 1"
	label values gendiff1 gendifference
	tab gendiff1 W9ZD9_1
	
	
	gen gendiff2 = . 
	replace gendiff2 = 1 if W9ZD9_2 == 5
	replace gendiff2 = 2 if W9ZD9_2 == 4
	replace gendiff2 = 3 if W9ZD9_2 == 3
	replace gendiff2 = 4 if W9ZD9_2 == 2
	replace gendiff2 = 5 if W9ZD9_2 == 1
	label var gendiff2 "General Difference with Disc. 2"
	label values gendiff2 gendifference
		tab gendiff2 W9ZD9_2

	
	gen gendiff3 = . 
	replace gendiff3 = 1 if W9ZD9_3 == 5
	replace gendiff3 = 2 if W9ZD9_3 == 4
	replace gendiff3 = 3 if W9ZD9_3 == 3
	replace gendiff3 = 4 if W9ZD9_3 == 2
	replace gendiff3 = 5 if W9ZD9_3 == 1
	label var gendiff3 "General Difference with Disc. 3"
	label values gendiff3 gendifference
	tab gendiff3 W9ZD9_3
	egen gendiff = rowmean(gendiff1 gendiff2 gendiff3)
	
*Partisan Disagreement
	*the partisanship of each discussant had to be first created
	*then the absolute difference between the respondent's pid and each discussant was taken
	*and then averaged
	gen pid_disc1 = . 
	replace pid_disc1 = 1 if W9ZD12_1 == 1 & W9ZD14_1 == 1
	replace pid_disc1 = 2 if W9ZD12_1 == 1 & W9ZD14_1 == 2
	replace pid_disc1 = 3 if W9ZD12_1 == 3 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD12_1 == 3 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD12_1 == 3 & W9ZD16_1 == 2
	replace pid_disc1 = 3 if W9ZD12_1 == 4 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD12_1 == 4 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD12_1 == 4 & W9ZD16_1 == 2
	replace pid_disc1 = 3 if W9ZD12_1 == -7 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD12_1 == -7 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD12_1 == -7 & W9ZD16_1 == 2
	replace pid_disc1 = 6 if W9ZD12_1 == 2 & W9ZD15_1 == 2
	replace pid_disc1 = 7 if W9ZD12_1 == 2 & W9ZD15_1 == 1
	replace pid_disc1 = 1 if W9ZD13_1 == 2 & W9ZD14_1 == 1
	replace pid_disc1 = 2 if W9ZD13_1 == 2 & W9ZD14_1 == 2
	replace pid_disc1 = 3 if W9ZD13_1 == 3 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD13_1 == 3 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD13_1 == 3 & W9ZD16_1 == 2
	replace pid_disc1 = 3 if W9ZD13_1 == 4 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD13_1 == 4 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD13_1 == 4 & W9ZD16_1 == 2
	replace pid_disc1 = 3 if W9ZD13_1 == -7 & W9ZD16_1 == 1
	replace pid_disc1 = 4 if W9ZD13_1 == -7 & W9ZD16_1 == 3
	replace pid_disc1 = 5 if W9ZD13_1 == -7 & W9ZD16_1 == 2
	replace pid_disc1 = 6 if W9ZD13_1 ==  1 & W9ZD15_1 == 2
	replace pid_disc1 = 7 if W9ZD13_1 ==  1 & W9ZD15_1 == 1
	label var pid_disc1 "Discussant 1 PID"
	label def pid_disc 1 "Str. Dem" 2 "Not Str. Dem" 3 "Lean Dem" 4 "Ind." 5 "Lean Rep" 6 "Not Str. Rep" 7 "Str. Rep"
	label values pid_disc1 pid_disc	
	
	tab pid_disc1 W9ZD12_1
	tab pid_disc1 W9ZD13_1
	tab pid_disc1 W9ZD16_1
	tab pid_disc1 W9ZD14_1
	tab pid_disc1 W9ZD15_1
	

	gen pid_disc2 = . 
	replace pid_disc2 = 1 if W9ZD12_2 == 1 & W9ZD14_2 == 1
	replace pid_disc2 = 2 if W9ZD12_2 == 1 & W9ZD14_2 == 2
	replace pid_disc2 = 3 if W9ZD12_2 == 3 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD12_2 == 3 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD12_2 == 3 & W9ZD16_2 == 2
	replace pid_disc2 = 3 if W9ZD12_2 == 4 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD12_2 == 4 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD12_2 == 4 & W9ZD16_2 == 2
	replace pid_disc2 = 3 if W9ZD12_2 == -7 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD12_2 == -7 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD12_2 == -7 & W9ZD16_2 == 2
	replace pid_disc2 = 6 if W9ZD12_2 == 2 & W9ZD15_2 == 2
	replace pid_disc2 = 7 if W9ZD12_2 == 2 & W9ZD15_2 == 1
	replace pid_disc2 = 1 if W9ZD13_2 == 2 & W9ZD14_2 == 1
	replace pid_disc2 = 2 if W9ZD13_2 == 2 & W9ZD14_2 == 2
	replace pid_disc2 = 3 if W9ZD13_2 == 3 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD13_2 == 3 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD13_2 == 3 & W9ZD16_2 == 2
	replace pid_disc2 = 3 if W9ZD13_2 == 4 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD13_2 == 4 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD13_2 == 4 & W9ZD16_2 == 2
	replace pid_disc2 = 3 if W9ZD13_2 == -7 & W9ZD16_2 == 1
	replace pid_disc2 = 4 if W9ZD13_2 == -7 & W9ZD16_2 == 3
	replace pid_disc2 = 5 if W9ZD13_2 == -7 & W9ZD16_2 == 2
	replace pid_disc2 = 6 if W9ZD13_2 ==  1 & W9ZD15_2 == 2
	replace pid_disc2 = 7 if W9ZD13_2 ==  1 & W9ZD15_2 == 1
	label var pid_disc2 "Discussant 2 PID"
	label values pid_disc2 pid_disc	
	
	tab pid_disc2 W9ZD12_2
	tab pid_disc2 W9ZD13_2
	tab pid_disc2 W9ZD16_2
	tab pid_disc2 W9ZD14_2
	tab pid_disc2 W9ZD15_2
	
	gen pid_disc3 = . 
	replace pid_disc3 = 1 if W9ZD12_3 == 1 & W9ZD14_3 == 1
	replace pid_disc3 = 2 if W9ZD12_3 == 1 & W9ZD14_3 == 2
	replace pid_disc3 = 3 if W9ZD12_3 == 3 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD12_3 == 3 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD12_3 == 3 & W9ZD16_3 == 2
	replace pid_disc3 = 3 if W9ZD12_3 == 4 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD12_3 == 4 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD12_3 == 4 & W9ZD16_3 == 2
	replace pid_disc3 = 3 if W9ZD12_3 == -7 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD12_3 == -7 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD12_3 == -7 & W9ZD16_3 == 2
	replace pid_disc3 = 6 if W9ZD12_3 == 2 & W9ZD15_3 == 2
	replace pid_disc3 = 7 if W9ZD12_3 == 2 & W9ZD15_3 == 1
	replace pid_disc3 = 1 if W9ZD13_3 == 2 & W9ZD14_3 == 1
	replace pid_disc3 = 2 if W9ZD13_3 == 2 & W9ZD14_3 == 2
	replace pid_disc3 = 3 if W9ZD13_3 == 3 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD13_3 == 3 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD13_3 == 3 & W9ZD16_3 == 2
	replace pid_disc3 = 3 if W9ZD13_3 == 4 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD13_3 == 4 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD13_3 == 4 & W9ZD16_3 == 2
	replace pid_disc3 = 3 if W9ZD13_3 == -7 & W9ZD16_3 == 1
	replace pid_disc3 = 4 if W9ZD13_3 == -7 & W9ZD16_3 == 3
	replace pid_disc3 = 5 if W9ZD13_3 == -7 & W9ZD16_3 == 2
	replace pid_disc3 = 6 if W9ZD13_3 ==  1 & W9ZD15_3 == 2
	replace pid_disc3 = 7 if W9ZD13_3 ==  1 & W9ZD15_3 == 1
	label var pid_disc3 "Discussant 2 PID"
	label values pid_disc3 pid_disc	
	
	tab pid_disc3 W9ZD12_3
	tab pid_disc3 W9ZD13_3
	tab pid_disc3 W9ZD16_3
	tab pid_disc3 W9ZD14_3
	tab pid_disc3 W9ZD15_3

	gen pdiff_1 = abs(pid9 - pid_disc1)
	gen pdiff_2 = abs(pid9 - pid_disc2)
	gen pdiff_3 = abs(pid9 - pid_disc3)
	tab pdiff_1
	tab pdiff_2
	tab pdiff_3
	egen pdiff_avg = rowmean(pdiff_1 pdiff_2 pdiff_3)
	label var pdiff_avg "Partisan Disagreement Scale"
